const request = require('./request');

module.exports = async query => {
  const data = {};
  let result;
  await request(
    'https://music.163.com/weapi/w/nuser/account/get',
    data,
    query.cookie,
  )
    .then(r => {
      result = r;
    })
    .catch(r => {
      //console.log(r);
    });

  //console.log(result);
  if (result.code === 200) {
    result = {
      status: 200,
      body: {
        data: {
          ...result,
        },
      },
      cookie: result.cookie,
    };
  }
  return result;
};
